package com.ycg.store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycg.store.common.Result;
import com.ycg.store.pojo.GoodType;
import com.ycg.store.service.GoodTypeService;
import com.ycg.store.mapper.GoodTypeMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【good_type(货品类型表)】的数据库操作Service实现
* @createDate 2024-05-24 20:04:33
*/
@Service
public class GoodTypeServiceImpl extends ServiceImpl<GoodTypeMapper, GoodType>
    implements GoodTypeService{

    /**
     * 根据租户id获取货品类型
     *
     * @param id 租户id
     * @return List<goodType>
     */
    @Override
    public Result<List<GoodType>> getByTenantId(String id) {
        LambdaQueryWrapper<GoodType> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(GoodType::getTenantId,id);
        List<GoodType> list = list(wrapper);
        return Result.ok(list);
    }
}




